import mockRequest from "@/utils/mockRequest";

interface OrderRandData {
  no: number;
  name: string;
  count: string;
}
interface SearchWordData {
  word: string;
  count: number;
  user: number;
}

export type EchartsData = {
  salesToday: number;
  salesLastDay: number;
  salesGrowthLastDay: number;
  salesGrowthLastMonth: number;

  orderToday: number;
  orderLastDay: number;
  orderTrend: number[];
  orderTrendAxis: string[];

  orderUser: number;
  returnRate: number;
  orderUserTrend: number[];
  orderUserTrendAxis: string[];

  usersTotal: number;
  usersLastDay: number;
  usersLastMonth: number;
  userGrowthLastDay: string;
  userGrowthLastMonth: string;

  orderFullYearAxis: string[];
  orderFullYear: number[];
  userFullYearAxis: string[];
  userFullYear: number[];

  orderRank: OrderRandData[];
  userRank: OrderRandData[];

  searchWord: SearchWordData[];
  saleRank: {
    category: {
      axisX: string[];
      data1: number[];
    };
    goods: {
      axisX: string[];
      data1: number[];
    };
  };
};

export function reqEchartsData() {
  return mockRequest.get<any, EchartsData>("/getechartsdata");
}
